package com.ruoyi.bcsettings.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bcsettings.mapper.ErpWarehousesMapper;
import com.ruoyi.bcsettings.domain.ErpWarehouses;
import com.ruoyi.bcsettings.service.IErpWarehousesService;

/**
 * 仓库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class ErpWarehousesServiceImpl implements IErpWarehousesService
{
    @Autowired
    private ErpWarehousesMapper erpWarehousesMapper;

    /**
     * 查询仓库
     * 
     * @param id 仓库主键
     * @return 仓库
     */
    @Override
    public ErpWarehouses selectErpWarehouseById(Integer id)
    {
        return erpWarehousesMapper.selectErpWarehouseById(id);
    }

    /**
     * 查询仓库列表
     * 
     * @param erpWarehouses 仓库
     * @return 仓库
     */
    @Override
    public List<ErpWarehouses> selectErpWarehouseList(ErpWarehouses erpWarehouses)
    {
        return erpWarehousesMapper.selectErpWarehouseList(erpWarehouses);
    }

    /**
     * 新增仓库
     * 
     * @param erpWarehouses 仓库
     * @return 结果
     */
    @Override
    public int insertErpWarehouse(ErpWarehouses erpWarehouses)
    {
        erpWarehouses.setCreateTime(DateUtils.getNowDate());
        return erpWarehousesMapper.insertErpWarehouse(erpWarehouses);
    }

    /**
     * 修改仓库
     * 
     * @param erpWarehouses 仓库
     * @return 结果
     */
    @Override
    public int updateErpWarehouse(ErpWarehouses erpWarehouses)
    {
        erpWarehouses.setUpdateTime(DateUtils.getNowDate());
        return erpWarehousesMapper.updateErpWarehouse(erpWarehouses);
    }

    /**
     * 批量删除仓库
     * 
     * @param ids 需要删除的仓库主键
     * @return 结果
     */
    @Override
    public int deleteErpWarehouseByIds(Integer[] ids)
    {
        return erpWarehousesMapper.deleteErpWarehouseByIds(ids);
    }

    /**
     * 删除仓库信息
     * 
     * @param id 仓库主键
     * @return 结果
     */
    @Override
    public int deleteErpWarehouseById(Integer id)
    {
        return erpWarehousesMapper.deleteErpWarehouseById(id);
    }
}
